package com.ftg.learn.controller;

import com.ftg.learn.entity.TeacherEntity;
import com.ftg.learn.service.TeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 布衣
 */
@RestController
@Api(tags = "老师管理")
@RequestMapping("/teacher")
public class TeacherController {

    @Resource
    TeacherService teacherService;

    @GetMapping("/list")
    @ApiOperation("获取老师列表")
    public List<TeacherEntity> list(
           @ApiParam(value = "姓名",required = true,name = "name") @RequestParam(value = "name",required = false) String name
    ) {
        return teacherService.list(name);
    }



}
